package algorithm.test1Tree.test2BST;

public class Node<E> {
    //节点存储打元素
    E element;
    Node<E> left;
    Node<E> right;
    Node<E> parent;
    //AVL树用来计算平衡因子（左子树的高度-右子树的高度）
    int height;

    public Node(E element, Node<E> parent) {
        this.element = element;
        this.parent = parent;
    }

    public boolean isleaf(){
        return left==null && right==null;
    }

    public boolean hasTwoChildren(){
        return left!=null && right!=null;
    }
}
